3.10.28 \(\int \frac {(a+b x)^n (c+d x)^2}{x^3} \, dx\) [928]

3.10.28.1 Optimal result
3.10.28.2 Mathematica [A] (verified)
3.10.28.3 Rubi [A] (verified)
3.10.28.4 Maple [F]
3.10.28.5 Fricas [F]
3.10.28.6 Sympy [B] (verification not implemented)
3.10.28.7 Maxima [F]
3.10.28.8 Giac [F]
3.10.28.9 Mupad [F(-1)]

3.10.28.1 Optimal result

Integrand size = 18, antiderivative size = 124 \[ \int \frac {(a+b x)^n (c+d x)^2}{x^3} \, dx=-\frac {c^2 (a+b x)^{1+n}}{2 a x^2}-\frac {c (4 a d-b c (1-n)) (a+b x)^{1+n}}{2 a^2 x}-\frac {\left (2 a^2 d^2+4 a b c d n-b^2 c^2 (1-n) n\right ) (a+b x)^{1+n} \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,1+\frac {b x}{a}\right )}{2 a^3 (1+n)} \]

output
-1/2*c^2*(b*x+a)^(1+n)/a/x^2-1/2*c*(4*a*d-b*c*(1-n))*(b*x+a)^(1+n)/a^2/x-1 
/2*(2*a^2*d^2+4*a*b*c*d*n-b^2*c^2*(1-n)*n)*(b*x+a)^(1+n)*hypergeom([1, 1+n 
],[2+n],1+b*x/a)/a^3/(1+n)
 
3.10.28.2 Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 94, normalized size of antiderivative = 0.76 \[ \int \frac {(a+b x)^n (c+d x)^2}{x^3} \, dx=-\frac {(a+b x)^{1+n} \left (a c (1+n) (b c (-1+n) x+a (c+4 d x))+\left (2 a^2 d^2+4 a b c d n+b^2 c^2 (-1+n) n\right ) x^2 \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,1+\frac {b x}{a}\right )\right )}{2 a^3 (1+n) x^2} \]

input
Integrate[((a + b*x)^n*(c + d*x)^2)/x^3,x]
 
output
-1/2*((a + b*x)^(1 + n)*(a*c*(1 + n)*(b*c*(-1 + n)*x + a*(c + 4*d*x)) + (2 
*a^2*d^2 + 4*a*b*c*d*n + b^2*c^2*(-1 + n)*n)*x^2*Hypergeometric2F1[1, 1 + 
n, 2 + n, 1 + (b*x)/a]))/(a^3*(1 + n)*x^2)
 
3.10.28.3 Rubi [A] (verified)

Time = 0.24 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.03, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {100, 87, 75}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(c+d x)^2 (a+b x)^n}{x^3} \, dx\)

\(\Big \downarrow \) 100

\(\displaystyle \frac {\int \frac {(a+b x)^n \left (2 a x d^2+c (4 a d-b c (1-n))\right )}{x^2}dx}{2 a}-\frac {c^2 (a+b x)^{n+1}}{2 a x^2}\)

\(\Big \downarrow \) 87

\(\displaystyle \frac {\frac {\left (2 a^2 d^2+4 a b c d n-b^2 c^2 (1-n) n\right ) \int \frac {(a+b x)^n}{x}dx}{a}-\frac {c (a+b x)^{n+1} (4 a d-b c (1-n))}{a x}}{2 a}-\frac {c^2 (a+b x)^{n+1}}{2 a x^2}\)

\(\Big \downarrow \) 75

\(\displaystyle \frac {-\frac {(a+b x)^{n+1} \left (2 a^2 d^2+4 a b c d n-b^2 c^2 (1-n) n\right ) \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {b x}{a}+1\right )}{a^2 (n+1)}-\frac {c (a+b x)^{n+1} (4 a d-b c (1-n))}{a x}}{2 a}-\frac {c^2 (a+b x)^{n+1}}{2 a x^2}\)

input
Int[((a + b*x)^n*(c + d*x)^2)/x^3,x]
 
output
-1/2*(c^2*(a + b*x)^(1 + n))/(a*x^2) + (-((c*(4*a*d - b*c*(1 - n))*(a + b* 
x)^(1 + n))/(a*x)) - ((2*a^2*d^2 + 4*a*b*c*d*n - b^2*c^2*(1 - n)*n)*(a + b 
*x)^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, 1 + (b*x)/a])/(a^2*(1 + n)) 
)/(2*a)
 

3.10.28.3.1 Defintions of rubi rules used

rule 75
Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((c + d*x 
)^(n + 1)/(d*(n + 1)*(-d/(b*c))^m))*Hypergeometric2F1[-m, n + 1, n + 2, 1 + 
 d*(x/c)], x] /; FreeQ[{b, c, d, m, n}, x] &&  !IntegerQ[n] && (IntegerQ[m] 
 || GtQ[-d/(b*c), 0])
 

rule 87
Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p 
_.), x_] :> Simp[(-(b*e - a*f))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p 
+ 1)*(c*f - d*e))), x] - Simp[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p 
+ 1)))/(f*(p + 1)*(c*f - d*e))   Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] 
/; FreeQ[{a, b, c, d, e, f, n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || Intege 
rQ[p] ||  !(IntegerQ[n] ||  !(EqQ[e, 0] ||  !(EqQ[c, 0] || LtQ[p, n]))))
 

rule 100
Int[((a_.) + (b_.)*(x_))^2*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^( 
p_), x_] :> Simp[(b*c - a*d)^2*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d^2*(d 
*e - c*f)*(n + 1))), x] - Simp[1/(d^2*(d*e - c*f)*(n + 1))   Int[(c + d*x)^ 
(n + 1)*(e + f*x)^p*Simp[a^2*d^2*f*(n + p + 2) + b^2*c*(d*e*(n + 1) + c*f*( 
p + 1)) - 2*a*b*d*(d*e*(n + 1) + c*f*(p + 1)) - b^2*d*(d*e - c*f)*(n + 1)*x 
, x], x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && (LtQ[n, -1] || (EqQ[n 
 + p + 3, 0] && NeQ[n, -1] && (SumSimplerQ[n, 1] ||  !SumSimplerQ[p, 1])))
 
3.10.28.4 Maple [F]

\[\int \frac {\left (b x +a \right )^{n} \left (d x +c \right )^{2}}{x^{3}}d x\]

input
int((b*x+a)^n*(d*x+c)^2/x^3,x)
 
output
int((b*x+a)^n*(d*x+c)^2/x^3,x)
 
3.10.28.5 Fricas [F]

\[ \int \frac {(a+b x)^n (c+d x)^2}{x^3} \, dx=\int { \frac {{\left (d x + c\right )}^{2} {\left (b x + a\right )}^{n}}{x^{3}} \,d x } \]

input
integrate((b*x+a)^n*(d*x+c)^2/x^3,x, algorithm="fricas")
 
output
integral((d^2*x^2 + 2*c*d*x + c^2)*(b*x + a)^n/x^3, x)
 
3.10.28.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1040 vs. \(2 (105) = 210\).

Time = 4.26 (sec) , antiderivative size = 1040, normalized size of antiderivative = 8.39 \[ \int \frac {(a+b x)^n (c+d x)^2}{x^3} \, dx=\text {Too large to display} \]

input
integrate((b*x+a)**n*(d*x+c)**2/x**3,x)
 
output
a**2*b**(n + 3)*c**2*n**3*(a/b + x)**(n + 1)*lerchphi(1 + b*x/a, 1, n + 1) 
*gamma(n + 1)/(-2*a**5*gamma(n + 2) - 4*a**4*b*x*gamma(n + 2) + 2*a**3*b** 
2*(a/b + x)**2*gamma(n + 2)) - a**2*b**(n + 3)*c**2*n*(a/b + x)**(n + 1)*l 
erchphi(1 + b*x/a, 1, n + 1)*gamma(n + 1)/(-2*a**5*gamma(n + 2) - 4*a**4*b 
*x*gamma(n + 2) + 2*a**3*b**2*(a/b + x)**2*gamma(n + 2)) - a**2*b**(n + 3) 
*c**2*n*(a/b + x)**(n + 1)*gamma(n + 1)/(-2*a**5*gamma(n + 2) - 4*a**4*b*x 
*gamma(n + 2) + 2*a**3*b**2*(a/b + x)**2*gamma(n + 2)) - a**2*b**(n + 3)*c 
**2*(a/b + x)**(n + 1)*gamma(n + 1)/(-2*a**5*gamma(n + 2) - 4*a**4*b*x*gam 
ma(n + 2) + 2*a**3*b**2*(a/b + x)**2*gamma(n + 2)) + 2*a*b*b**(n + 3)*c**2 
*n**3*x*(a/b + x)**(n + 1)*lerchphi(1 + b*x/a, 1, n + 1)*gamma(n + 1)/(-2* 
a**5*gamma(n + 2) - 4*a**4*b*x*gamma(n + 2) + 2*a**3*b**2*(a/b + x)**2*gam 
ma(n + 2)) - a*b*b**(n + 3)*c**2*n**2*x*(a/b + x)**(n + 1)*gamma(n + 1)/(- 
2*a**5*gamma(n + 2) - 4*a**4*b*x*gamma(n + 2) + 2*a**3*b**2*(a/b + x)**2*g 
amma(n + 2)) - 2*a*b*b**(n + 3)*c**2*n*x*(a/b + x)**(n + 1)*lerchphi(1 + b 
*x/a, 1, n + 1)*gamma(n + 1)/(-2*a**5*gamma(n + 2) - 4*a**4*b*x*gamma(n + 
2) + 2*a**3*b**2*(a/b + x)**2*gamma(n + 2)) + a*b*b**(n + 3)*c**2*x*(a/b + 
 x)**(n + 1)*gamma(n + 1)/(-2*a**5*gamma(n + 2) - 4*a**4*b*x*gamma(n + 2) 
+ 2*a**3*b**2*(a/b + x)**2*gamma(n + 2)) - b**2*b**(n + 3)*c**2*n**3*(a/b 
+ x)**2*(a/b + x)**(n + 1)*lerchphi(1 + b*x/a, 1, n + 1)*gamma(n + 1)/(-2* 
a**5*gamma(n + 2) - 4*a**4*b*x*gamma(n + 2) + 2*a**3*b**2*(a/b + x)**2*...
 
3.10.28.7 Maxima [F]

\[ \int \frac {(a+b x)^n (c+d x)^2}{x^3} \, dx=\int { \frac {{\left (d x + c\right )}^{2} {\left (b x + a\right )}^{n}}{x^{3}} \,d x } \]

input
integrate((b*x+a)^n*(d*x+c)^2/x^3,x, algorithm="maxima")
 
output
integrate((d*x + c)^2*(b*x + a)^n/x^3, x)
 
3.10.28.8 Giac [F]

\[ \int \frac {(a+b x)^n (c+d x)^2}{x^3} \, dx=\int { \frac {{\left (d x + c\right )}^{2} {\left (b x + a\right )}^{n}}{x^{3}} \,d x } \]

input
integrate((b*x+a)^n*(d*x+c)^2/x^3,x, algorithm="giac")
 
output
integrate((d*x + c)^2*(b*x + a)^n/x^3, x)
 
3.10.28.9 Mupad [F(-1)]

Timed out. \[ \int \frac {(a+b x)^n (c+d x)^2}{x^3} \, dx=\int \frac {{\left (a+b\,x\right )}^n\,{\left (c+d\,x\right )}^2}{x^3} \,d x \]

input
int(((a + b*x)^n*(c + d*x)^2)/x^3,x)
 
output
int(((a + b*x)^n*(c + d*x)^2)/x^3, x)